﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CategoryOption_List.aspx.cs"
    MasterPageFile="~/Admin/Admin.Master" Inherits="TimKen.Web.POption_List" %>

<asp:Content runat="server" ContentPlaceHolderID="ContentLinkAction" ID="link">
    <span class="action-span"><a href="../ProductCategory/ProductCategory_List.aspx">
        <%=GetLangString("MenuProductCategory")%></a></span> <span class="action-span"><a href="AddOpToCategory.aspx?CategoryID=<%=CategoryID%>">
            <%=GetLangString("AddOptionToCategory")%></a></span> <span class="action-span"><a href="POption_Add.aspx?CategoryID=<%=CategoryID%>">
                <%=GetLangString("AddNewOption")%></a></span>
</asp:Content>
<asp:Content runat="server" ContentPlaceHolderID="ContentTitle" ID="title">
    <%=GetLangString("CategoryOptionList")%></asp:Content>
<asp:Content runat="server" ContentPlaceHolderID="ContentMain" ID="main">
    <div class="form-div">
        <%=GetLangString("ChooseCategory")%>：
        <asp:DropDownList ID="dplCategroy" runat="server" OnSelectedIndexChanged="dplCategroy_SelectedIndexChanged"
            AutoPostBack="True">
        </asp:DropDownList>
    </div>
    <div class="list-div">
        <asp:GridView ID="grdOption" runat="server" CssClass="grid" PageSize="15" AutoGenerateColumns="False"
            DataKeyNames="OptionID" OnRowCommand="grdOption_RowCommand">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <%=GetLangString("OptionName")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("OptionName")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <%=GetLangString("FieldMetaData")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("FieldMetaData")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemStyle Width="150" HorizontalAlign="Center" />
                    <HeaderTemplate>
                        <%=GetLangString("FieldType")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#GetOptionType(Eval("FieldType").ToString()) %></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemStyle Width="80" HorizontalAlign="Center" />
                    <HeaderTemplate>
                        <%=GetLangString("UpdateOrder")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:TextBox ID="txtOrder" runat="server" Text=' <%# Eval("SortOrder") %>' Width="35px"></asp:TextBox>
                        &nbsp;
                        <asp:ImageButton ID="btnUpdateOrder" runat="server" ToolTip='<%#GetLangString("Update")%>'
                            CommandName="UpdateOrder" CommandArgument='<%#Eval("OptionID")%>' ImageUrl="~/Admin/images/icon_OK.gif" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemStyle Width="80" HorizontalAlign="Center" />
                    <HeaderTemplate>
                        <%=GetLangString("Operation")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:ImageButton ID="btnRemove" runat="server" ToolTip='<%#GetLangString("Remove")%>'
                            CommandName="Remove" CommandArgument='<%#Eval("OptionID")%>' ImageUrl="~/Admin/images/icon_drop.gif"
                            OnClientClick="return deleteConfirm()" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle HorizontalAlign="Center" />
            <EmptyDataTemplate>
                <%=GetLangString("CategoryNoOption")%>
            </EmptyDataTemplate>
        </asp:GridView>
        <ux:AspNetPager ID="AspNetPager1" runat="server" HorizontalAlign="right" PageIndexBoxType="DropDownList"
            OnPageChanged="AspNetPager1_PageChanged" ImagePath="/images/" 
                        NavigationButtonType="Image" ButtonImageNameExtension="n" 
                        CpiButtonImageNameExtension="r" PagingButtonType="Image">
        </ux:AspNetPager>
    </div>
</asp:Content>
